package com.zmn.oms.business.impl.third;

import com.zmn.oms.business.interfaces.third.HaobaiExtendOrderService;
import com.zmn.oms.model.entity.third.HaobaiExtendOrder;
import com.zmn.oms.persistence.interfaces.third.HaobaiExtendOrderDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Optional;

/**
 * @author: huangyifeng
 * @description: 号百订单扩展实现
 * @create: 2020-03-12 11:51
 **/
@Service
public class HaobaiExtendOrderServiceImpl implements HaobaiExtendOrderService {

    @Resource
    private HaobaiExtendOrderDao haobaiExtendOrderDao;

    @Override
    public HaobaiExtendOrder findByOrderId(Long orderId) {
        if (!Optional.ofNullable(orderId).isPresent()) {
            return null;
        }

        return haobaiExtendOrderDao.findByOrderId(orderId);
    }

    @Override
    public void save(HaobaiExtendOrder haobaiExtendOrder) {

        haobaiExtendOrderDao.save(haobaiExtendOrder);
    }
}
